﻿@model System.Collections.Generic.List<smartcrm.Factory>

<script src="../../Scripts/factory.js"></script><div class="FR">
<input type="button" value="新增" id="btnNew" />
</div>

<div class="list">
<table id="tFactory">
<thead>
<tr>
<th>名称</th>
<th>联系人</th>
<th>描述</th>
<th>操作</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
        {
            <tr id="@item.FactoryNo">
                <td style="width:15%">@Html.DisplayFor(modelItem => item.FactoryName)</td>
                <td style="width:25%">@Html.Raw(item.Contact)</td>
                <td>@Html.DisplayFor(modelItem => item.Description)</td>
                <td style="width:6%">
                    <img src="../../Images/grid/edit.png" title="编辑" onclick="javascript:EditFactory('@item.FactoryNo')" />
                    <img src="../../Images/grid/delete.png" title="删除" onclick="javascript:DeleteFactory('@item.FactoryNo')"/>  
                </td>
            </tr>
        }
</tbody>
</table>
</div>


<div id="divFactory" title="加工商信息" style="display:none">      
    <div id="divFactoryContent" style="overflow-y: auto; height: 240px;">          
        @using (Html.BeginForm())
        {
            <table class="font85 tableEdit">                
                <tr>
                    <td class="label">名称</td>
                    <td>
                        @Html.TextBox("FactoryName", null, new { maxlength = "50" })&nbsp;<span class="redStar">*</span>                                                                   
                    </td>
                </tr>
                 <tr>
                    <td class="label">联系人</td>
                    <td>
                        @Html.TextArea("Contact", null, new { maxlength = "200",@style="height:70px" })                                                              
                    </td>
                </tr>
                <tr>
                    <td class="label">描述</td>
                    <td>
                        @Html.TextArea("Description", null, new { maxlength = "200", @style = "height:80px" })                       
                        @Html.Hidden("FactoryNo")
                     </td>
                </tr>                
            </table>                        
        }
    </div>  
    <div style="text-align:right;"> 
        <span id="errorMessage" class="errorSpan"></span>  
       <input type="button" id="btnSave" value="保存" />
       <input type="button" id="btnCancel" value="取消" />    
    </div>  
</div>  